package com.example.sort;

/**
 * Created by SOAL on 2017/2/24 0024.
 */
public class User implements Comparable<User>{
    private String name;
    private Integer order;
    private Integer age;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getOrder() {
        return order;
    }
    public void setOrder(Integer order) {
        this.order = order;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public int compareTo(User arg0) {
        return
//                this.getOrder().compareTo(arg0.getOrder()) &
                 this.getAge().compareTo(arg0.getAge())
                ;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", order=" + order +
                ", age=" + age +
                '}';
    }
}

